﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QualityRpt.Dao;
using QualityRpt.Utils;

namespace QualityRpt.Service
{
    public class ServiceInfoService:BaseService
    {
        private static IServiceInfoDao _impDao = null;
        static ServiceInfoService()
        {
            _impDao = CreateDaoInstance("IServiceInfoDao") as IServiceInfoDao;
        }
        public static DataTable GetSchema()
        {
            DataTable rtTable = _impDao.GetList("ID=0");
            return rtTable.Clone();
        }
        public static DataRow Save(DataRow row)
        {
            return _impDao.Save(row);
        }
        public static DataRow Update(DataRow row)
        {
            return _impDao.Update(row);
        }
        public static DataRow Get(long id)
        {
            return _impDao.Get(id);
        }
        public static void Delete(long id)
        {
            _impDao.Delete(id);
        }
        /// <summary>
        /// where中列需要 S.开头
        /// </summary>
        /// <param name="pu"></param>
        /// <param name="where"></param>
        /// <returns></returns>
        public static DataTable GetList(PageUtils pu, string where)
        {
            return _impDao.GetPageList(pu, where, string.Empty); ;
        }
        public static DataTable GetList(string where)
        {
            return _impDao.GetList(where);
        }
        public static DataTable GetList(string where, string sort)
        {
            return _impDao.GetList(where, sort);
        }
		/// <summary>
		/// 获得任务列表中的最大数据截止时间
		/// </summary>
		public static DateTime? GetMaxDataEndTime(){
			return _impDao.GetMaxDataEndTime ();
		}
    }
}
